<?php
declare (strict_types = 1);
namespace app\user\service\user;

use app\common\service\BaseService;
use app\common\exception\LogicException;
use think\facade\Request;
use app\user\logic\user\Profile as ProfileLogic;
use app\user\logic\user\PunchIn as PunchInLogic;

/**
 * 用户个人中心接口类
 */
class Profile extends BaseService
{

    public function index()
    {
        $data = app(ProfileLogic::class)->index();

        return $this->parseToData($data, 1, '获取成功');
    }

    // 签到
    public function punchIn()
    {
        $data = app(PunchInLogic::class)->doPunchIn();

        return $this->parseToData($data, 1, '签到成功');
    }

    // 三方绑定状态
    public function thirdloginBindStatus()
    {
        $data = app(ProfileLogic::class)->thirdloginBindStatus();

        return $this->parseToData($data, 1, '获取成功');
    }

    // 三方绑定
    public function thirdloginBind()
    {
        $param = Request::post();
        $data = app(ProfileLogic::class)->thirdloginBind($param);

        return $this->parseToData($data, 1, '绑定成功');
    }

    // 三方绑定解绑
    public function thirdloginBindDelete()
    {
        $param = Request::delete();
        app(ProfileLogic::class)->thirdloginBindDelete($param);

        return $this->parseToData([], 1, '解绑成功');
    }

}
